package com.hmall.api.pay;

import com.hmall.api.pay.dto.PayApplyDTO;
import com.hmall.api.pay.dto.PayOrderFormDTO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * TODO
 *
 * @Date 2025/11/9 23:19
 */
@FeignClient(name = "pay-service",path = "/pay-orders")
public interface PayClient {
    @ApiOperation("生成支付单")
    @PostMapping
    String applyPayOrder(@RequestBody PayApplyDTO applyDTO);
    @ApiOperation("尝试基于用户余额支付")
    @ApiImplicitParam(value = "支付单id", name = "id")
    @PostMapping("{id}")
    void tryPayOrderByBalance(@PathVariable("id") Long id, @RequestBody PayOrderFormDTO payOrderFormDTO);
}
